global class OwnerReassignment implements Database.Batchable<sObject>{
global String query;
global String email;
global Id toUserId;
global Id fromUserId;
global Database.querylocator start(Database.BatchableContext BC){
return Database.getQueryLocator(query);}
global void execute(Database.BatchableContext BC, List<sObject> scope){
List<Parent__c> invs = new List<Parent__c>();
for(sObject s : scope){
Parent__c a = (Parent__c)s;
if(a.OwnerId==fromUserId){
a.OwnerId=toUserId;
invs.add(a);
}
}
update invs;
}
global void finish(Database.BatchableContext BC){
}
}